-
Notifications
You must be signed in to change notification settings - Fork 794
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Puppet-Datatype Sensitive #1400
Use Puppet-Datatype Sensitive #1400
Conversation
cocker-cc
commented
Jun 16, 2021
- fix some Puppetlint-Complaints, f.e. use Hash $::facts['blubb'] instead of specific global Variables
- let Function mysql::password accept Datatype Sensitive for Password
- let Function mysql_password accept Datatype Sensitive for Password
- add Parameter "sensitive" to Function mysql::password to decide if its Returnvalue should be of Datatype Sensitive
- add Parameter "sensitive" to Function mysql_password to decide if its Returnvalue should be of Datatype Sensitive
- let mysql_user accept Datatype Sensitive for Parameter password_hash
- let mysql::backup::mysqlbackup accept Datatype Sensitive for Parameter $backuppassword
- let mysql::backup::mysqldump accept Datatype Sensitive for Parameter $backuppassword
- let mysql::backup::xtrabackup accept Datatype Sensitive for Parameter $backuppassword
- let mysql::db accept Datatype Sensitive for Parameter $password
- let mysql::server accept Datatype Sensitive for Parameter $root_password
- let mysql::server::backup accept Datatype Sensitive for Parameter $backuppassword
- let mysql::server::monitor accept Datatype Sensitive for Parameter $mysql_monitor_password
- let mysql::server::root_password accept Datatype Sensitive for $root_password
- refactor Logic for unset Password for mysql::server::root_password
end | ||
|
||
# Test of a Returnvalue of Datatype Sensitive does not work: | ||
# it 'returns Sensitive with sensitive=true' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @cocker-cc
Just wondering if you have more information on why this test does not work? I would be inclined to advise if there is a suitable reason, marking this test in the suite as pending and just adding the comment as to why for future reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is an example from stdlib on how to mark as pending: https://github.com/puppetlabs/puppetlabs-stdlib/blob/276e7b7cd97580c9c08b264b3727e5902df1f487/spec/functions/is_mac_address_spec.rb#L22
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering if you have more information on why this test does not work?
Too bad, I have no Idea how to make this Test work
manifests/backup/mysqlbackup.pp
Outdated
@@ -32,6 +32,11 @@ | |||
$compression_command = undef, | |||
$compression_extension = undef, | |||
) inherits mysql::params { | |||
if $backuppassword =~ Sensitive { | |||
$_backuppassword = $backuppassword.unwrap |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this isn't a big deal but would it be possible to rename this variable? I found when reviewing this PR with a colleague it took us a while to work out what it is doing. I would suggest using something such as plaintext_backuppassword
. (this name change will need revisited throughout your codebase changes).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now it's done. I needed a second push
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @cocker-cc |
Thanks. Reason for that one is: we switched from Trocla to Vault, and our Function |
- fix some Puppetlint-Complaints, f.e. use Hash $::facts['blubb'] instead of specific global Variables - let Function mysql::password accept Datatype Sensitive for Password - let Function mysql_password accept Datatype Sensitive for Password - add Parameter "sensitive" to Function mysql::password to decide if its Returnvalue should be of Datatype Sensitive - add Parameter "sensitive" to Function mysql_password to decide if its Returnvalue should be of Datatype Sensitive - let mysql_user accept Datatype Sensitive for Parameter password_hash - let mysql::backup::mysqlbackup accept Datatype Sensitive for Parameter $backuppassword - let mysql::backup::mysqldump accept Datatype Sensitive for Parameter $backuppassword - let mysql::backup::xtrabackup accept Datatype Sensitive for Parameter $backuppassword - let mysql::db accept Datatype Sensitive for Parameter $password - let mysql::server accept Datatype Sensitive for Parameter $root_password - let mysql::server::backup accept Datatype Sensitive for Parameter $backuppassword - let mysql::server::monitor accept Datatype Sensitive for Parameter $mysql_monitor_password - let mysql::server::root_password accept Datatype Sensitive for $root_password - refactor Logic for unset Password for mysql::server::root_password
What a fantastic addition to our code base @cocker-cc. |
Changes will be released on our next Community Day (Monday) |